/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client;

import javax.swing.*;
import java.awt.*;
import metier.Simulateur;

/**
 *
 * @author Vincent
 */
public class SimIHM extends javax.swing.JFrame {
    MenuPrincipal menu;
    Simulateur sim;
    String nomSimu;
    /**
     * Creates new form SimIHM
     */
    public SimIHM(MenuPrincipal menu, int taille, String nomSimu) {
        initComponents();
        
        this.menu = menu;
        if (nomSimu==null){
            this.nomSimu = "SimulationSansNom";
        } else {
            this.nomSimu = nomSimu;
        }
        if (!this.nomSimu.equals("SimulationSansNom") && !this.nomSimu.equals("")){
            textFieldExport.setText(this.nomSimu);
            checkBoxExport.setEnabled(true);
        }
        
        //Nouvelle instance de Simulateur, permettant d'afficher la grille du simulateur...
        //Prend en paramètres un objet de type SimIHM, et un int (la taille de la grille)
        if (taille>=10) {
            sim = new Simulateur(this, taille);
        } else {
            int[] tailleMode = this.menu.co.chargerSimulationTailleMode(nomSimu);
            taille = tailleMode[0];
            int mode = tailleMode[1];
            sim = new Simulateur(this, taille);
            int grilleChargee[][] = this.menu.co.chargerGrille(nomSimu, taille);
            sim.remplacerGrille(grilleChargee);
            sim.setSimMode(mode);
        }
        
        //Permet de centrer la Jframe
        setLocation(Toolkit.getDefaultToolkit().getScreenSize().width/2-(sim.getWidth()/2+getWidth()+10),//getWidth()+taille*5+10),
                Toolkit.getDefaultToolkit().getScreenSize().height/2-getHeight()/2);
        
        //Permet de formater les spinners
        spinnerAuto.setModel(new SpinnerNumberModel(new Float(1), new Float(0.25f), new Float(10), new Float(0.25f)));
        JFormattedTextField tf = ((JSpinner.DefaultEditor)spinnerAuto.getEditor()).getTextField();
        tf.setEnabled(false);
        spinnerStep.setModel(new SpinnerNumberModel(new Integer(1), new Integer(1), new Integer(100), new Integer(1)));
        tf = ((JSpinner.DefaultEditor)spinnerStep.getEditor()).getTextField();
        tf.setEnabled(false);
        
        //Permet de ne pas redimensionner la fenêtre
        setResizable(false);
        
        //Met à jour la couleur de la case à placer
        updateCaseAPlacer();
    }
    
    public int getSpinnerStepValue() {
        return (Integer)spinnerStep.getValue();
    }
    
    public boolean isExporting(){
        return checkBoxExport.isSelected();
    }
    
    public String getNomSimu(){
        return nomSimu;
    }
    
    public String getNomExport(){
        return textFieldExport.getText();
    }
    
    public void stopAuto() {
            sim.stoperAuto();
            toggleBoutonAuto.setText("Auto");
            menuSimMode.setEnabled(true);
            menuSimFichier.setEnabled(true);
            toggleBoutonAuto.setSelected(false);
            activerBoutons();
    }

    private void activerBoutons() {
        int mode = sim.getSimMode();
        switch (mode){
            case 0:
                boutonArbre.setEnabled(true);
                boutonArbuste.setEnabled(true);
                boutonJPousse.setEnabled(true);
            break;
        }
        boutonPas.setEnabled(true);
    }
    
    private void updateCaseAPlacer(){
        int c = sim.caseAPlacer;
        switch (c){
            case 1:
                panelCase.setBackground(new Color(161, 214, 92));
            break;
                
            case 2:
                panelCase.setBackground(new Color(19, 173, 47));
            break;
                
            case 4:
                panelCase.setBackground(new Color(18, 97, 8));
            break;
                
            case 5:
                panelCase.setBackground(Color.red);
            break;
                
            case 7:
                panelCase.setBackground(new Color(192, 32, 255));
            break;
                
            default:
                panelCase.setBackground(Color.white);
            break;
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        labelForet = new javax.swing.JLabel();
        boutonArbre = new javax.swing.JButton();
        boutonArbuste = new javax.swing.JButton();
        boutonJPousse = new javax.swing.JButton();
        labelCaseAPlacer = new javax.swing.JLabel();
        boutonPas = new javax.swing.JButton();
        spinnerAuto = new javax.swing.JSpinner();
        toggleBoutonAuto = new javax.swing.JToggleButton();
        labelSimulation = new javax.swing.JLabel();
        spinnerStep = new javax.swing.JSpinner();
        checkBoxExport = new javax.swing.JCheckBox();
        panelCase = new javax.swing.JPanel();
        textFieldExport = new javax.swing.JTextField();
        labelIntervalle = new javax.swing.JLabel();
        labelPas = new javax.swing.JLabel();
        menuSim = new javax.swing.JMenuBar();
        menuSimFichier = new javax.swing.JMenu();
        menuSimFichierNouveau = new javax.swing.JMenuItem();
        menuSimFichierCharger = new javax.swing.JMenuItem();
        menuSimFichierSauvegarder = new javax.swing.JMenuItem();
        menuSimFichierEffacer = new javax.swing.JMenuItem();
        menuSimMode = new javax.swing.JMenu();
        menuSimModeForet = new javax.swing.JMenuItem();
        menuSimModeFeu = new javax.swing.JMenuItem();
        menuSimModeInsectes = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        labelForet.setText("Végétaux :");

        boutonArbre.setText("Arbre");
        boutonArbre.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                boutonArbreMouseClicked(evt);
            }
        });

        boutonArbuste.setText("Arbuste");
        boutonArbuste.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                boutonArbusteMouseClicked(evt);
            }
        });

        boutonJPousse.setText("Jeune pousse");
        boutonJPousse.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                boutonJPousseMouseClicked(evt);
            }
        });

        labelCaseAPlacer.setText("Placement de la case :");

        boutonPas.setText("Pas");
        boutonPas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                boutonPasMouseClicked(evt);
            }
        });

        spinnerAuto.setToolTipText("Intervalle de temps (en secondes) entre les simulations");
        spinnerAuto.setValue(0.1);

        toggleBoutonAuto.setLabel("Auto");
        toggleBoutonAuto.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                toggleBoutonAutoMouseReleased(evt);
            }
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                toggleBoutonAutoMouseClicked(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                toggleBoutonAutoMousePressed(evt);
            }
        });

        labelSimulation.setText("Simulation");

        spinnerStep.setToolTipText("Nombre de simulations à effectuer à chaque pas");

        checkBoxExport.setText("Exportation .csv");
        checkBoxExport.setToolTipText("Vous devez sauvegarder la simulation pour activer l'exportation en .cvs");
        checkBoxExport.setEnabled(false);
        checkBoxExport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkBoxExportActionPerformed(evt);
            }
        });

        panelCase.setBackground(new java.awt.Color(153, 255, 0));
        panelCase.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout panelCaseLayout = new javax.swing.GroupLayout(panelCase);
        panelCase.setLayout(panelCaseLayout);
        panelCaseLayout.setHorizontalGroup(
            panelCaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 21, Short.MAX_VALUE)
        );
        panelCaseLayout.setVerticalGroup(
            panelCaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 20, Short.MAX_VALUE)
        );

        textFieldExport.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                textFieldExportKeyTyped(evt);
            }
        });

        labelIntervalle.setText("Δt (s):");

        labelPas.setText("Pas (µ):");

        menuSimFichier.setText("Fichier");

        menuSimFichierNouveau.setText("Nouvelle simulation");
        menuSimFichierNouveau.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                menuSimFichierNouveauMouseReleased(evt);
            }
        });
        menuSimFichier.add(menuSimFichierNouveau);

        menuSimFichierCharger.setText("Charger simulation");
        menuSimFichierCharger.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                menuSimFichierChargerMouseReleased(evt);
            }
        });
        menuSimFichier.add(menuSimFichierCharger);

        menuSimFichierSauvegarder.setText("Sauvegarder simulation");
        menuSimFichierSauvegarder.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                menuSimFichierSauvegarderMouseReleased(evt);
            }
        });
        menuSimFichier.add(menuSimFichierSauvegarder);

        menuSimFichierEffacer.setText("Effacer la grille");
        menuSimFichierEffacer.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                menuSimFichierEffacerMouseReleased(evt);
            }
        });
        menuSimFichier.add(menuSimFichierEffacer);

        menuSim.add(menuSimFichier);

        menuSimMode.setText("Mode");

        menuSimModeForet.setText("Croissance de la forêt");
        menuSimModeForet.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                menuSimModeForetMousePressed(evt);
            }
        });
        menuSimMode.add(menuSimModeForet);

        menuSimModeFeu.setText("Incendie");
        menuSimModeFeu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                menuSimModeFeuMousePressed(evt);
            }
        });
        menuSimMode.add(menuSimModeFeu);

        menuSimModeInsectes.setText("Invasion d'insectes");
        menuSimModeInsectes.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                menuSimModeInsectesMouseReleased(evt);
            }
        });
        menuSimMode.add(menuSimModeInsectes);

        menuSim.add(menuSimMode);

        setJMenuBar(menuSim);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(labelForet)
                            .addComponent(boutonJPousse)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(boutonArbre)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(boutonArbuste)))
                        .addGap(22, 26, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(labelCaseAPlacer)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(panelCase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(labelSimulation)
                            .addComponent(textFieldExport, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(checkBoxExport)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(spinnerAuto)
                                    .addComponent(toggleBoutonAuto, javax.swing.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(labelIntervalle)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(layout.createSequentialGroup()
                                            .addGap(10, 10, 10)
                                            .addComponent(labelPas))
                                        .addComponent(boutonPas, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(spinnerStep, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelForet)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(boutonArbre)
                    .addComponent(boutonArbuste))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(boutonJPousse)
                .addGap(11, 11, 11)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(labelCaseAPlacer)
                    .addComponent(panelCase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addComponent(checkBoxExport)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textFieldExport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(labelSimulation)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(toggleBoutonAuto)
                    .addComponent(boutonPas))
                .addGap(12, 12, 12)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelIntervalle)
                    .addComponent(labelPas))
                .addGap(5, 5, 5)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(spinnerAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(spinnerStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(19, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void boutonPasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boutonPasMouseClicked
        // TODO add your handling code here:
        if (boutonPas.isEnabled()) {
            sim.simulerRafraichir((Integer)spinnerStep.getValue());
        }
    }//GEN-LAST:event_boutonPasMouseClicked

    private void toggleBoutonAutoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_toggleBoutonAutoMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_toggleBoutonAutoMouseClicked

    private void boutonArbreMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boutonArbreMouseClicked
        // TODO add your handling code here:
        if (boutonArbre.isEnabled()){
            sim.setCaseAPlacer(4);
            updateCaseAPlacer();
        }
    }//GEN-LAST:event_boutonArbreMouseClicked

    private void boutonArbusteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boutonArbusteMouseClicked
        // TODO add your handling code here:
        if (boutonArbuste.isEnabled()){
            sim.setCaseAPlacer(2);
            updateCaseAPlacer();
        }
        
    }//GEN-LAST:event_boutonArbusteMouseClicked

    private void boutonJPousseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boutonJPousseMouseClicked
        // TODO add your handling code here:
        if (boutonJPousse.isEnabled()){
            sim.setCaseAPlacer(1);
            updateCaseAPlacer();
        }
    }//GEN-LAST:event_boutonJPousseMouseClicked

    private void menuSimModeForetMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menuSimModeForetMousePressed
        // TODO add your handling code here:
        sim.setSimMode(0);
        boutonArbre.setEnabled(true);
        boutonArbuste.setEnabled(true);
        boutonJPousse.setEnabled(true);
        updateCaseAPlacer();
    }//GEN-LAST:event_menuSimModeForetMousePressed

    private void menuSimModeFeuMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menuSimModeFeuMousePressed
        // TODO add your handling code here:
        sim.setSimMode(1);
        boutonArbre.setEnabled(false);
        boutonArbuste.setEnabled(false);
        boutonJPousse.setEnabled(false);
        updateCaseAPlacer();
    }//GEN-LAST:event_menuSimModeFeuMousePressed

    private void toggleBoutonAutoMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_toggleBoutonAutoMousePressed
         // TODO add your handling code here:
    }//GEN-LAST:event_toggleBoutonAutoMousePressed

    private void toggleBoutonAutoMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_toggleBoutonAutoMouseReleased
         // TODO add your handling code here:
        if (toggleBoutonAuto.isSelected()) {
            sim.autoSimuler((Float)spinnerAuto.getValue());
            //Merci fatjo pour cet idée..
            toggleBoutonAuto.setText("Stop");
            menuSimMode.setEnabled(false);
            menuSimFichier.setEnabled(false);
            boutonArbre.setEnabled(false);
            boutonArbuste.setEnabled(false);
            boutonJPousse.setEnabled(false);
            boutonPas.setEnabled(false);
        } else {
            sim.stoperAuto();
            toggleBoutonAuto.setText("Auto");
            menuSimMode.setEnabled(true);
            menuSimFichier.setEnabled(true);
            activerBoutons();
        }
    }//GEN-LAST:event_toggleBoutonAutoMouseReleased

    private void menuSimModeInsectesMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menuSimModeInsectesMouseReleased
        // TODO add your handling code here:
        sim.setSimMode(2);
        boutonArbre.setEnabled(false);
        boutonArbuste.setEnabled(false);
        boutonJPousse.setEnabled(false);
        updateCaseAPlacer();
    }//GEN-LAST:event_menuSimModeInsectesMouseReleased

    private void menuSimFichierEffacerMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menuSimFichierEffacerMouseReleased
        // TODO add your handling code here:
        sim.effacerGrille();
    }//GEN-LAST:event_menuSimFichierEffacerMouseReleased

    private void menuSimFichierNouveauMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menuSimFichierNouveauMouseReleased
        // TODO add your handling code here:
        menu.nouvelleGrille();
        sim.dispose();
        this.dispose();
    }//GEN-LAST:event_menuSimFichierNouveauMouseReleased

    private void menuSimFichierChargerMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menuSimFichierChargerMouseReleased
        // TODO add your handling code here:
        new DialogueChargerSimulation(this, null).setVisible(true);
        setVisible(false);
    }//GEN-LAST:event_menuSimFichierChargerMouseReleased

    private void menuSimFichierSauvegarderMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menuSimFichierSauvegarderMouseReleased
        // TODO add your handling code here:
        new DialogueSauvegarder(this).setVisible(true);
        setVisible(false);
    }//GEN-LAST:event_menuSimFichierSauvegarderMouseReleased

    private void checkBoxExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkBoxExportActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_checkBoxExportActionPerformed

    private void textFieldExportKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_textFieldExportKeyTyped
        // TODO add your handling code here:
        if (!textFieldExport.getText().trim().isEmpty()){
            checkBoxExport.setEnabled(true);
        } else {
            checkBoxExport.setEnabled(false);
            checkBoxExport.setSelected(false);
        }
    }//GEN-LAST:event_textFieldExportKeyTyped

    /**
     * @param args the command line arguments
     */
//    public static void main(String args[]) {
//        /* Set the Nimbus look and feel */
//        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
//        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
//         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
//         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//            java.util.logging.Logger.getLogger(SimIHM.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(SimIHM.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(SimIHM.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(SimIHM.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
//        //</editor-fold>
//
//        /* Create and display the form */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new SimIHM(int taille).setVisible(true);
//            }
//        });
//    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton boutonArbre;
    private javax.swing.JButton boutonArbuste;
    private javax.swing.JButton boutonJPousse;
    private javax.swing.JButton boutonPas;
    private javax.swing.JCheckBox checkBoxExport;
    private javax.swing.JLabel labelCaseAPlacer;
    private javax.swing.JLabel labelForet;
    private javax.swing.JLabel labelIntervalle;
    private javax.swing.JLabel labelPas;
    private javax.swing.JLabel labelSimulation;
    private javax.swing.JMenuBar menuSim;
    private javax.swing.JMenu menuSimFichier;
    private javax.swing.JMenuItem menuSimFichierCharger;
    private javax.swing.JMenuItem menuSimFichierEffacer;
    private javax.swing.JMenuItem menuSimFichierNouveau;
    private javax.swing.JMenuItem menuSimFichierSauvegarder;
    private javax.swing.JMenu menuSimMode;
    private javax.swing.JMenuItem menuSimModeFeu;
    private javax.swing.JMenuItem menuSimModeForet;
    private javax.swing.JMenuItem menuSimModeInsectes;
    private javax.swing.JPanel panelCase;
    private javax.swing.JSpinner spinnerAuto;
    private javax.swing.JSpinner spinnerStep;
    private javax.swing.JTextField textFieldExport;
    private javax.swing.JToggleButton toggleBoutonAuto;
    // End of variables declaration//GEN-END:variables
}
